/**
 * Created by henian.xu on 2017/7/3 0003.
 * 实用工具类
 */

// 浮动与清除浮动
.fn-left {
    float: left;
}

.fn-right {
    float: right;
}

.fn-clear {
    @include clearfix;
}

// 隐藏
.fn-hide {
    overflow: hidden !important;
}

// 超出隐藏
.fn-hidden {
    overflow: hidden !important;
}

.fn-hidden-x {
    overflow-x: hidden !important;
}

.fn-hidden-y {
    overflow-y: hidden !important;
}

// 字体大小
.fs-small {
    font-size: 75% !important;
}

.fs-normal {
    font-size: inherit !important;
}

.fs-big {
    font-size: 120% !important;
}

.fs-more {
    font-size: 150% !important;
}

.fs-super {
    font-size: 200% !important;
}

// 字体加粗
.fw-bold {
    font-weight: bold !important;
}

.fw-normal {
    font-weight: normal !important;
}

// 文本对齐
@each $key, $value in (c:center, l:left, r:right, j:justify) {
    .ta-#{$key} {
        text-align: $value !important;
    }
}

// 垂直对齐
@each $key, $value in (t:top, m:middle, b:bottom) {
    .va-#{$key} {
        vertical-align: $value !important;
    }
}

// 1px 边框
@each $key, $value in (a:'', t:'-top', r:'-right', b:'-bottom', l:'-left') {
    .bor-#{$key} {
        border#{$value}: 1px solid $color-border !important;
    }
}

// 模盒
@each $key, $value in (b:block, i:inline, ib:inline-block) {
    .dp-#{$key} {
        display: $value !important;
    }
}

// 宽度
@for $i from 1 through 20 {
    .w-#{$i * 5}per {
        width: $i * 5% !important;
    }
}

@for $i from 1 through 20 {
    .w-#{$i * 5}px {
        width: $i * 5px !important;
    }
}

@for $i from 1 through 20 {
    .w-#{$i}em {
        width: $i + em !important;
    }
}

// 高度
@for $i from 1 through 20 {
    .h-#{$i * 5}per {
        height: $i * 5% !important;
    }
}

@for $i from 1 through 20 {
    .h-#{$i * 5}px {
        height: $i * 5px !important;
    }
}

@for $i from 1 through 20 {
    .h-#{$i}em {
        height: $i + em !important;
    }
}

// 行高
@for $i from 1 through 20 {
    .lh-#{$i * 5}per {
        line-height: $i * 5% !important;
    }
}

@for $i from 1 through 20 {
    .lh-#{$i * 5}px {
        line-height: $i * 5px !important;
    }
}

@for $i from 1 through 20 {
    .lh-#{$i}em {
        line-height: $i + em !important;
    }
}

.lh-normal {
    line-height: $line-height !important;
}

// 颜色
$colors: (
    g1:$gray1,
    g2:$gray2,
    g3:$gray3,
    g4:$gray4,
    g5:$gray5,
    main:$color-main,
    second:$color-second,
);

// 字体颜色
.tc-base {
    color: $color-text !important;
}

@each $key, $value in $colors {
    .tc-#{$key} {
        color: $value !important;
    }
}

// 背景颜色
@each $key, $value in $colors {
    .bc-#{$key} {
        background-color: $value !important;
    }
}

// 间距
@each $key, $value in (a:'', t:'-top', r:'-right', b:'-bottom', l:'-left') {
    .ma-#{$key} {
        margin#{$value}: $margin !important;
    }
    .nma-#{$key} {
        margin#{$value}: 0 !important;
    }
    .pa-#{$key} {
        padding#{$value}: $padding !important;
    }
    .npa-#{$key} {
        padding#{$value}: 0 !important;
    }
}
